require 'rubygems'
require 'rufus/scheduler'
scheduler = Rufus::Scheduler.start_new

#every day at 2:00
scheduler.cron '0 2 * * 1-7' do
  sql = "update resources set day_score = 0"
  ActiveRecord::Base.connection.execute(sql)
end

#every weekend
scheduler.cron '00 2 * * 7' do
  sql = "update resources set week_score = 0"
  ActiveRecord::Base.connection.execute(sql)
end

#every month
scheduler.cron '00 2 1 * *' do
  sql = "update resources set month_score = 0"
  ActiveRecord::Base.connection.execute(sql)
end


